package com.hyt.it.ogt.ks.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;

/**
 * @author wuyingge
 * @ClassName MongodbToLocalDateTime.java
 * @Description MongoDB -> Java
 * @createTime 2021年11月12日 18:03:00
 */
@ReadingConverter
public class MongodbToLocalDateTime implements Converter<String, LocalDateTime> {

    @Override
    public LocalDateTime convert(String source) {
        return LocalDateTime.parse(source, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
    }
}
